package test;

import com.google.common.base.Objects;

/**
 * Created by Arat.Wu on 2018/08/28.
 */
public class IntegrSwap {

    private static class User{
        private String id;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        @Override
        public String toString() {
            return Objects.toStringHelper(this)
                    .add("id", id)
                    .toString();
        }
    }
    public static void main(String[] args){
        Integer a=1;
        Integer b=2;
        User user= new User();
        String s="aaaaaaaaaa";
        System.out.println("a="+a+",b="+b+",user="+user+",s="+s);
        swap(a,b,user,s);
        System.out.println("a="+a+",b="+b+",user="+user+",s="+s);
        set(a,b,user,s);
        System.out.println("a="+a+",b="+b+",user="+user+",s="+s);
        Boolean t = Boolean.FALSE;
        if (t) {
            System.out.println("a=" + a + ",b=" + b + ",user=" + user + ",s=" + s);
        }

    }

    public static void swap(Integer a,Integer b,User user,String s){
        Integer temp=a;
        a=b;
        b=temp;
        user.setId("1111111111");
        s="swap";
    }

    public static void set(Integer a,Integer b,User user,String s){
        a= 199;
        b= 4;
        user.setId("2222222");
        s="set";

    }
}
